package com.example.lockfulldemo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 渠道类型枚举值
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ChannelCodeEnum {
    DL(0,"盗龄空间"),
    ACTIVITY(1,"拼团"),
    ;
    private Integer code;
    private String name;

    public static String getNameByCode(Integer code) {
        for (ChannelCodeEnum enumValue : values()) {
            if (enumValue.code.equals(code)) {
                return enumValue.getName();
            }
        }
        return null;
    }
}
